<?php
$control->renderView('weChatShare');
//获取当前user信息
$userCooker = new BAUserCooker();
$userInfo = $userCooker->getUserInfo();
//var_dump($userInfo);
$familyNameAttr = '';
$surNameAttr = '';
if ($userInfo->getItem('familyName') != NULL)
    $familyNameAttr = $userInfo->getItem('familyName')->getValue();
if ($userInfo->getItem('surName') != NULL)
    $surNameAttr = $userInfo->getItem('surName')->getValue();

//判断用户是否领取了卡
$BAMember = new BAMemberCardCooker();
$userMemberCardList = $BAMember->getUserMemberCardList();

//获取当前用户的积分
$BAMemberPoint = new BAMemberPointCooker();
$myMemberPoint = '0';
if ($userInfo != NULL) {
    $memberPointType = $BAMemberPoint->getMemberPointType();
    if ($memberPointType != NULL) {
        $memberPointAccountTable = new BASpaceSheet('memberPointAccount', $memberPointType);
        $itemData['userInfoId'] = $userInfo->getId();
        $memberPointAccount = $memberPointAccountTable->getList(array('itemData' => $itemData));
        if ($memberPointAccount && $memberPointAccount->getItem('memberPoint') != NULL) {
            $myMemberPoint = $memberPointAccount->getItem('memberPoint')->getValue();
        }
    }
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl . '/css/BWeMember/wei_webapp_new.css' ?>">
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl . '/css/BWeMember/wei_dialog.css' ?>">
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl . '/css/BWeMember/common.css' ?>">

<!-- ajax加载页面时弹出加载旋转gif图 -->
<style>
    #ajax-loaderdiv {position: fixed;top: 0;left: 0;width: 100%;height: 100%;z-index: 35000;background-color: rgba(0, 0, 0, 0.3);display: none;}
    .ajax-loader {position: absolute;left: 50%;top: 50%;margin-left: -16px;margin-top: -16px;display: block;}
</style>
<div id="ajax-loaderdiv" style="display: none;">
    <img src="<?php echo Yii::app()->request->baseUrl . '/images/ajax-loader.gif' ?>" class="ajax-loader">
</div>


<div id="page_card" class="div-body">

    <div id="mappContainer">
        <div class="inner root" >
            <div class="card" style="background:url(<?php echo Yii::app()->request->baseUrl . '/images/BWeMember/wei_webapp_new/card_bk_1.png' ?>) no-repeat 0 0;-webkit-background-size:267px 159px;background-size:267px 159px;" data-card-type="0">
                <img src="<?php echo Yii::app()->request->baseUrl . '/images/BWeMember/weixin_shop_logo/2543529110_card_170_170.png' ?>" class="logo"> 
                <h1></h1>
                <strong class="pdo verify">
                    <span style="color:#92714e;text-shadow:0 1px #f1e7dc;"><em style="color:#92714e;text-shadow:0 1px #f1e7dc;"><?php echo'会员名'; ?></em><?php echo $familyNameAttr . $surNameAttr; ?></span>
                </strong>
            </div>
            <p><span>
                    <?php
                    if ($userMemberCardList) {
                        //如果领取了会员卡
                        echo '使用时向服务员出示此卡';
                    } else {
                        echo '请在"我的会员卡"中领取会员卡';
                    }
                    ?>
                </span></p>
            <ul class="round" id="privates">  
                <?php
                $ajaxScript3 = $control->getAjaxScript('showCurrentMemberPointAccountListInMobile', array(
                    'cooker' => 'BAMemberPoint@showCurrentMemberPointAccountList',
                ));
                ?>
                <li style="background:url('<?php echo Yii::app()->request->baseUrl; ?> /images/BWeMember/wei_webapp_new/icon_score.png') no-repeat 9px 14px;-webkit-background-size:24px 21px;background-size:24px 21px;" >
                    <a class="score" href="javascript:void(0)" onclick="<?php echo $ajaxScript3 ?>">积分数: <?php echo $myMemberPoint; ?></a>
                </li>
            </ul>
            <ul class="round" id="additional">
                <li>
                    <?php
                    $ajaxScript3 = $control->getAjaxScript('showUserCardListInMobile', array(
                        'cooker' => 'BAMemberCard@showUserCardList'
                    ));
                    ?>
                    <a class="record" href="#" onclick="<?php echo $ajaxScript3 ?>">我的会员卡</a>
                </li>
            </ul>
            <ul class="round" id="additional">
                <li>
                    <?php
                    $ajaxScript3 = $control->getAjaxScript('showUserCardListInMobile', array(
                        'cooker' => 'BAVoucher@showUserVoucherListInMobile',
                    ));
                    ?>
                    <a class="record" href="#" onclick="<?php echo $ajaxScript3 ?>">我的代金券</a>
                </li>
            </ul>
            <ul class="round" id="additional">
                <li>
                    <?php
                    $ajaxScript4 = $control->getAjaxScript('showCardUserBillListInMobile', array(
                        'cooker' => 'BAMemberCard@showCardUserBillList',
                    ));
                    ?>
                    <a class="record" href="#" onclick="<?php echo $ajaxScript4 ?>">我的消费记录</a>
                </li>
            </ul>
        </div>
    </div>

    <div id="mCopyright" style="height: 33px;">
        <div class="mcrInn">
            <h1>比邻平台</h1>
        </div>
    </div>

</div>
